package com.csq.portal.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.csq.cms.service.ParttimeService;
import com.csq.manager.pojo.Parttime;
import com.github.pagehelper.PageInfo;

@Controller
@RequestMapping("/web")
public class PageController {

	@Autowired
	private ParttimeService parttimeService;

	@RequestMapping(value = "/index")
	public String index(HttpServletRequest request, Integer page, Integer row) {

		PageInfo<Parttime> allNewParttimePageInfo = parttimeService
				.getAllNewParttime(page, row);

		PageInfo<Parttime> allHotParttimePageInfo = parttimeService
				.getAllHotParttime(page, row);

		request.setAttribute("allNewParttimePageInfo", allNewParttimePageInfo);
		request.setAttribute("allHotParttimePageInfo", allHotParttimePageInfo);

		return "/web/parttime/index";
	}

	@RequestMapping(value = "/company/index")
	public String companyIndex() {
		return "/web/company/index";
	}

	@RequestMapping(value = "/account/index")
	public String accountIndex() {
		return "/web/account/index";
	}

	@RequestMapping(value = "/error/400")
	public String page404() {
		return "/web/error/404";
	}

	@RequestMapping(value = "/error/500")
	public String page500() {
		return "/web/error/500";
	}

	@RequestMapping(value = "/company/addParttime")
	public String pageAddParttime() {
		return "/web/company/addParttime";
	}

	@RequestMapping(value = "/error/index")
	public String errorPage() {
		return "/web/error/index";
	}

	@RequestMapping(value = "/account/edit/password")
	public String accountEditPassword() {
		return "/web/account/editPassword";
	}
	
	@RequestMapping(value="/account/editAccount")
	public String accountEditAccount() {
		return "/web/account/editAccount";
	}

}
